package com.qf;

import com.qf.util.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author 千锋健哥
 */
@SpringBootApplication
public class MongoApplication {

    public static void main(String[] args) {
        SpringApplication.run(MongoApplication.class, args);
    }

    /**
     * 初始化雪花算法
     * @return
     */
    @Bean
    public IdWorker idWorker() {
        //第一参数: 机器码, 第二参数: 随机数种子
        return new IdWorker(1, 1);
    }
}
